<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>msg</title>
    <link rel="stylesheet" href="css/show.css">
</head>
<body>
	
	<jsp:include page="top.jsp"></jsp:include>

    <div class="details">
        <h2>${onelost.ltitle }</h2>
        <p class="nike">${onelost.user.unikename }</p>
        <img src="${onelost.limg }" alt="">
        <p class="text">${onelost.lmsg }</p>
        <br><p class="nike">${onelost.ldate }</p><br>
    </div>
    <div class="comment">
        <div class="comment-text">
            <form action="${pageContext.request.contextPath}/addComment?lid=${onelost.lid }" method="POST">
                <textarea name="ccontent" cols="70" rows="4 " placeholder="有头绪？快点告诉贴主吧~" required="required"></textarea>
                <button type="submit">发表评论</button>
            </form>
        </div>
        <div class="all-comment">
                <ul>
	                <c:forEach items="${comments }" var="comment">
		                    <li>
		                       <div class="comment-body">
		                            <p>${comment.ccontent }</p>
		                            <p style="text-align: right;">来自：<a href="toSendNews?rid=${comment.user.uid }">${comment.user.unikename }</a>&nbsp;&nbsp;${comment.cdate }</p>
		                        </div>
		                    </li>
		                </c:forEach>
                    <c:if test="${!empty comments}">
                        <li>
                            <span class="page" style="margin-left: 160px;"><a href="allComments?set=top">首页</a></span>
                            <span class="page"><a href="allComments?set=sub">上一页</a></span>
                            <span class="page">第&nbsp;${comment_page.getStart()}&nbsp;页</span>
                            <span class="page"><a href="allComments?set=add">下一页</a></span>
                            <span class="page"><a href="allComments?set=bottom">尾页</a></span>
                            <span class="page" style="width: 140px;margin-bottom: 50px;">共&nbsp;${comment_page.getTotalPage()}&nbsp;页&nbsp;${comment_page.getTotal()}&nbsp;条数据</span>
                        </li>
                    </c:if>
                </ul>
        </div>
    </div>
    <br><br><br><br><br>
    <div class="lxbz">
        <a href="toSendNews?&rid=${onelost.user.uid }&lid=${onelost.lid }"><button>联系版主</button></a>
    </div>

</body>
</html>